#include <stdio.h>
#include <string.h>
#include <stdlib.h>


void removeChar(char* p, char r){
	int l = strlen(p);
	char* buf = (char*)malloc( (l+1)*sizeof(char));

	int indx = 0;
	for(int i=0; i < l; i++){
		if(p[i] != r){
			buf[indx] = p[i];	
			indx++;
		}
	}
	strncpy(p, buf, l);
	free(buf);
}

int main(){
	char p[] = "hello world";
	removeChar(p, 'l');

	printf("%s\n", p);
	return 0;
}
